<?php
	/**
	 * Value object representation of a calendar event.
	 */
	class EventVO {
		
		var $_explicitType="vo.EventVO";
		
		/** The unique ID of the event. */
		var $eventUID;
		
		/** The group the event was posted on. */
		var $groupUID;
		
		/** The date the event will take place. */
		var $eventDate;
		
		/** The name of the event. */
		var $eventName;
		
		/** The description of the event. */
		var $description;
		
		/** True, if the logged in user has reserved for the event, otherwise false. */
		var $reserved;
		
		/** Creates a new instance of a EventVO. */
		public function EventVO() {}
		
		/**
		 * Maps a database record to a EventVO.
		 * @param $row The record to map to a EventVO.
		 * @return A new mapped instance of a EventVO.
		 */
		public static function mapObject($row) {
			
			$vo = new EventVO();
			
			$vo->eventUID 		= $row["eventUID"];
			$vo->groupUID 		= $row["groupUID"];
			$vo->eventDate 		= $row["eventDate"];
			$vo->eventName 		= $row["eventName"];
			$vo->description 	= $row["description"];
			$vo->reserved 		= ($row["reserved"] == 1? true:false);
			
			return $vo;
		}
	}
?>